<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <%- include ../taglibs/layout_head.ejs%>
    <%- include ../taglibs/layout.css.ejs%>
    <script type="text/javascript">
        String.prototype.replaceAll = function (reallyDo, replaceWith) {
            return this.replace(new RegExp(reallyDo, ("gm")), replaceWith);
        };
        var parentMenuList = '<%= parentMenuList%>';
        var  sysMap = '<%= sysMap%>';
        var _parentMenuList,
            _sysMap;
        if(parentMenuList !="false"){
            if(parentMenuList.indexOf("&quot;") != -1){
                _parentMenuList = parentMenuList.replaceAll("&quot;", "\"");
            }else if(parentMenuList.indexOf("&#34;") != -1){
                _parentMenuList = parentMenuList.replaceAll("&#34;", "\"");
            }
            window.sessionStorage.setItem("rootMenus",_parentMenuList);
        }
        if(sysMap !="false"){
            if(sysMap.indexOf("&quot;") != -1){
                _sysMap = sysMap.replaceAll("&quot;", "\"");
            }else if(sysMap.indexOf("&#34;") != -1){
                _sysMap = sysMap.replaceAll("&#34;", "\"");
            }
            window.sessionStorage.setItem("chidlMenus",_sysMap)
        }
    </script>
</head>
<body>
<%-include("../taglibs/header.ejs",{params:{className:"active",systemIsActive:"true"}})%>
<div class="nav-body" id="divContent">
    <div class="nav-box">
        <div class="row">
            <div class="col-sm-4 col-md-3 col-lg-2 nav-box-left-box">
                <%-include("systemLeftMenu.ejs",{params:{className:"active",dataSetting:"true"}})%>
            </div>
            <div class="col-sm-6 col-md-9 col-lg-10 right-container-box">
                <div class="right-container">
                    <!--<div class="row">-->
                    <!--<div class="col-sm-12">-->
                    <!--<a class="back-view" id="back-view">-->
                    <!--<i class="fa fa-chevron-left fa-back-left"></i>-->
                    <!--返回-->
                    <!--</a>-->
                    <!--</div>-->
                    <!--</div>-->
                    <section class="content content-table">
                        <div style="display: block">
                            <ol class="head-breadcrumb">
                                <li>
                                    <a>系统设置</a>
                                </li>
                                <li class="active">
                                    大数据参数设置
                                </li>
                            </ol>
                            <div class="form-content">
                                <form class="form-horizontal form-validBox" id="userInfoForm">
                                    <div class="form-group">
                                        <label for="inputEmail3" class="col-sm-2 col-sm-offset-3 control-label ">离线设备（有线）参数：</label>
                                        <div class="col-sm-4">
                                            <input type="text" class="form-control" id="inputEmail3" name="unlineData">
                                        </div>
                                        <div class="col-sm-1" style="height: 34px;line-height: 34px;">
                                            <span>天</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="userName" class="col-sm-2 col-sm-offset-3 control-label">未行使车辆参数：</label>
                                        <div class="col-sm-4">
                                            <input type="text" class="form-control" id="userName" name="noneRunData">
                                        </div>
                                        <div class="col-sm-1" style="height: 34px;line-height: 34px;">
                                            <span>天</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="userName" class="col-sm-2 col-sm-offset-3 control-label">未按时上线(无线)车辆参数：</label>
                                        <div class="col-sm-4">
                                            <input type="text" class="form-control" id="unlineDeviceData" name="unlineDeviceData">
                                        </div>
                                        <div class="col-sm-1" style="height: 34px;line-height: 34px;">
                                            <span>天</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="userName" class="col-sm-2 col-sm-offset-3 control-label">安全码：</label>
                                        <div class="col-sm-4">
                                            <input type="text" class="form-control" id="baseTerminalServicePw" name="baseTerminalServicePw">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="linkName" class="col-sm-2 col-sm-offset-3 control-label"></label>
                                        <div class="col-sm-4" >
                                            <button type="button" id="submitFormData" class="btn btn-round btn-theme" style="width: 100%">保 存</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </div>
    </div>
</div>
<%-include ../taglibs/layout.js.ejs%>
<script type="text/javascript" src="js/viewpage/systemManage/systemManage.js"></script>
<script type="text/javascript" src="js/viewpage/dataManage/userInfo/userInfo.js"></script>
<script type="text/javascript">
    $(function () {
        $.post("/systemManage/queryAqms",null,function (result) {
            if(result && result.isSuccess){
                if(result.data && result.data.obj){
                    $("#baseTerminalServicePw").val(result.data.obj)
                }
            }
        });
        UserInfo.initEditUserPage();

        if(window.localStorage.getItem("unlineData")){
            $("input[name='unlineData']").val(window.localStorage.getItem("unlineData"))
        }else{
            $("input[name='unlineData']").val("3")
        }
        if(window.localStorage.getItem("noneRunData")){
            $("input[name='noneRunData']").val(window.localStorage.getItem("noneRunData"))
        }else {
            $("input[name='noneRunData']").val("2")
        }
        if(window.localStorage.getItem("unlineDeviceData")){
            $("input[name='unlineDeviceData']").val(window.localStorage.getItem("unlineDeviceData"))
        }else {
            $("input[name='unlineDeviceData']").val("3")
        }
        $("#submitFormData").click(function () {
            if($("#baseTerminalServicePw").val()){
                $.post("/systemManage/makeAqms",{baseTerminalServicePw:$("#baseTerminalServicePw").val()},function (result) {
                },"json");
            }
            window.localStorage.setItem("unlineData",$("input[name='unlineData']").val());
            window.localStorage.setItem("noneRunData",$("input[name='noneRunData']").val());
            window.localStorage.setItem("unlineDeviceData",$("input[name='unlineDeviceData']").val());
            $.messageExt.alert("系统提示","参数设置成功！","success");
        })
    })
</script>
</body>
</html>